import { defineStore } from 'pinia'
import { ref } from 'vue'
import { store } from '@/store'

export const useAppStore = defineStore('app', () => {
  const menuCollapse = ref(false)
  // 更新配置
  function updateSettings(partial) {
    menuCollapse.value = partial.menuCollapse
  }

  return { menuCollapse, updateSettings }
})

// 非setup
export function useAppStoreHook() {
  return useAppStore(store)
}
